[HVM] Fix timer interrupt underflow bug.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Sat, 23 Sep 2006 13:04:22 +0000 (14:04 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Sat, 23 Sep 2006 13:04:22 +0000 (14:04 +0100)
Without the patch, vlapic->intr_pending_count could become a very
small negative, causing some local APIC timer interrupts lost.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
xen/arch/x86/hvm/vlapic.c

index a3ed24a491f81797f0d7557a5664a3242b42d54d..533b6c8237473cf75010e6b9b4d38cc03c021677 100644 (file)
@@ -946,9 +946,11 @@ void vlapic_post_injection(struct vcpu *v, int vector, int deliver_mode)
 
         if ( vector == vlapic_lvt_vector(vlapic, APIC_LVTT) )
         {
-            vlapic->intr_pending_count[vector]--;
             if ( vlapic->intr_pending_count[vector] > 0 )
+            {
+                vlapic->intr_pending_count[vector]--;
                 vlapic_test_and_set_vector(vector, vlapic->regs + APIC_IRR);
+            }
         }
         break;